package com.laze.mywanandroid.api

import com.orhanobut.logger.Logger

data class ApiBean<T>(val errorCode: Int, val errorMsg: String, val data: T) {
    fun apiData(): T {
        if (errorCode == 0){
            Logger.d(data.toString())
            return data
        }else{
            throw ApiException(errorCode,errorMsg)
        }
    }
}